<?php

namespace App\Http\Middleware;

use App\Http\Controllers\Common;
use App\Http\Controllers\ErrorCode;
use App\Http\Requests\UserRequest;
use Closure;

class CustomApi
{
    use Common;
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $token = $request->input('sign','');
        $timestamp = $request->input('timestamp','');

        //TODO verify token
        if (!$token || !$timestamp){
            return $this->json_echo('#false','','验签错误');
        }

        return $next($request);
    }
}
